
<?php echo $header;?>

  <div class="breadcrumb">

    <?php foreach ($breadcrumbs as $breadcrumb) { ?>

    <a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>

    <?php } ?>

  </div>

<div id="notification"></div>

<?php if ($error_warning) { ?>

<div class="warning"><?php echo $error_warning; ?></div>

<?php } ?>

<?php echo $column_left; ?><?php echo $column_right; ?>

<div id="content"><?php echo $content_top; ?>

  <h1><?php echo $heading_title; ?></h1>

  <div class="h1-bb"></div>

  <p><?php echo $text_account_already; ?></p>

  <p><?php echo $text_signup; ?></p>

  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">

    <h2><?php echo $text_your_details; ?></h2>

    <div class="content">

      <table class="form">

        <tr>

          <td><span class="required">*</span> <?php echo $entry_firstname; ?></td>

          <td><input type="text" name="firstname" value="<?php echo $firstname; ?>" />

            <?php if ($error_firstname) { ?>

            <span class="error"><?php echo $error_firstname; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_lastname; ?></td>

          <td><input type="text" name="lastname" value="<?php echo $lastname; ?>" />

            <?php if ($error_lastname) { ?>

            <span class="error"><?php echo $error_lastname; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_email; ?></td>

          <td><input type="text" name="email" value="<?php echo $email; ?>" />

            <?php if ($error_email) { ?>

            <span class="error"><?php echo $error_email; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>

          <td><input type="text" name="telephone" value="<?php echo $telephone; ?>" />

            <?php if ($error_telephone) { ?>

            <span class="error"><?php echo $error_telephone; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><?php echo $entry_fax; ?></td>

          <td><input type="text" name="fax" value="<?php echo $fax; ?>" /></td>

        </tr>

      </table>

    </div>

    <h2><?php echo $text_your_address; ?></h2>

    <div class="content">

      <table class="form">

        <tr>

          <td><?php echo $entry_company; ?></td>

          <td><input type="text" name="company" value="<?php echo $company; ?>" /></td>

        </tr>

        <tr>

          <td><?php echo $entry_website; ?></td>

          <td><input type="text" name="website" value="<?php echo $website; ?>" /></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_address_1; ?></td>

          <td><input type="text" name="address_1" value="<?php echo $address_1; ?>" />

            <?php if ($error_address_1) { ?>

            <span class="error"><?php echo $error_address_1; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><?php echo $entry_address_2; ?></td>

          <td><input type="text" name="address_2" value="<?php echo $address_2; ?>" /></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_city; ?></td>

          <td><input type="text" name="city" value="<?php echo $city; ?>" />

            <?php if ($error_city) { ?>

            <span class="error"><?php echo $error_city; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span id="postcode-required" class="required">*</span> <?php echo $entry_postcode; ?></td>

          <td><input type="text" name="postcode" value="<?php echo $postcode; ?>" />

            <?php if ($error_postcode) { ?>

            <span class="error"><?php echo $error_postcode; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_country; ?></td>

          <td><select name="country_id">

              <option value="false"><?php echo $text_select; ?></option>

              <?php foreach ($countries as $country) { ?>

              <?php if ($country['country_id'] == $country_id) { ?>

              <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>

              <?php } else { ?>

              <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>

              <?php } ?>

              <?php } ?>

            </select>

            <?php if ($error_country) { ?>

            <span class="error"><?php echo $error_country; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_zone; ?></td>

          <td><select name="zone_id">

            </select>

            <?php if ($error_zone) { ?>

            <span class="error"><?php echo $error_zone; ?></span>

            <?php } ?></td>

        </tr>

      </table>

    </div>

    <h2><?php echo $text_payment; ?></h2>

    <div class="content">

      <table class="form">

        <tbody>

          <tr>

            <td><?php echo $entry_tax; ?></td>

            <td><input type="text" name="tax" value="<?php echo $tax; ?>" /></td>

          </tr>

          <tr>

            <td><?php echo $entry_payment; ?></td>

            

                <td>
                <?php if ($cheque_visible) { ?>
                   <?php if ($payment == 'cheque') { ?>
                      <input type="radio" name="payment" value="cheque" id="cheque" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="cheque" id="cheque" />
                   <?php } ?>
                <label for="cheque"><?php echo $text_cheque; ?></label><br><br>
                <?php } ?>
                <?php if ($paypal_visible) { ?>
                   <?php if ($payment == 'paypal') { ?>
                      <input type="radio" name="payment" value="paypal" id="paypal" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="paypal" id="paypal" />
                   <?php } ?>
                      <label for="paypal"><?php echo $text_paypal; ?></label><br><br>
                   <?php } ?>
                <?php if ($bank_visible) { ?>
                   <?php if ($payment == 'bank_name') { ?>
                      <input type="radio" name="payment" value="bank" id="bank" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="bank" id="bank" />
                   <?php } ?>
                      <label for="bank"><?php echo $text_bank; ?></label><br><br>
                   <?php } ?>
                <?php if ($qiwi_visible) { ?>
                   <?php if ($payment == 'qiwi') { ?>
                      <input type="radio" name="payment" value="qiwi" id="qiwi" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="qiwi" id="qiwi" />
                   <?php } ?>
                      <label for="qiwi"><?php echo $text_qiwi; ?></label><br><br>
                <?php } ?>
                <?php if ($card_visible) { ?>
                   <?php if ($payment == 'card') { ?>
                      <input type="radio" name="payment" value="card" id="card" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="card" id="card" />
                   <?php } ?>
                      <label for="card"><?php echo $text_card; ?></label><br><br>
                 <?php } ?>
                 <?php if ($yandex_visible) { ?>
                   <?php if ($payment == 'yandex') { ?>
                      <input type="radio" name="payment" value="yandex" id="yandex" checked="checked" />
                   <?php } else { ?>
                      <input type="radio" name="payment" value="yandex" id="yandex" />
                   <?php } ?>
                      <label for="yandex"><?php echo $text_yandex; ?></label><br><br>
                 <?php } ?>
                 <?php if ($webmoney_visible) { ?>
                    <?php if ($payment == 'webmoney') { ?>
                       <input type="radio" name="payment" value="webmoney" id="webmoney" checked="checked" />
                    <?php } else { ?>
                       <input type="radio" name="payment" value="webmoney" id="webmoney" />
                    <?php } ?>
                       <label for="webmoney"><?php echo $text_webmoney; ?></label><br><br>
				  <?php } ?>
                  <?php if ($webmoney_visibleWMZ) { ?>
                     <?php if ($payment == 'webmoneyWMZ') { ?>
                       <input type="radio" name="payment" value="webmoneyWMZ" id="webmoneyWMZ" checked="checked" />
                     <?php } else { ?>
                       <input type="radio" name="payment" value="webmoneyWMZ" id="webmoneyWMZ" />
					 <?php } ?>
                       <label for="webmoneyWMZ"><?php echo $text_webmoneyWMZ; ?></label><br><br>
                  <?php } ?>
				  <?php if ($webmoney_visibleWMU) { ?>
                     <?php if ($payment == 'webmoneyWMU') { ?>
                       <input type="radio" name="payment" value="webmoneyWMU" id="webmoneyWMU" checked="checked" />
                     <?php } else { ?>
                       <input type="radio" name="payment" value="webmoneyWMU" id="webmoneyWMU" />
                     <?php } ?>
                       <label for="webmoneyWMU"><?php echo $text_webmoneyWMU; ?></label><br><br>
                  <?php } ?>
                  <?php if ($webmoney_visibleWME) { ?>
					  <?php if ($payment == 'webmoneyWME') { ?>
					  <input type="radio" name="payment" value="webmoneyWME" id="webmoneyWME" checked="checked" />
					  <?php } else { ?>
					  <input type="radio" name="payment" value="webmoneyWME" id="webmoneyWME" />
					  <?php } ?>
					  <label for="webmoneyWME"><?php echo $text_webmoneyWME; ?></label><br><br>
                  <?php } ?>
                  <?php if ($webmoney_visibleWMY) { ?>
					  <?php if ($payment == 'webmoneyWMY') { ?>
					  <input type="radio" name="payment" value="webmoneyWMY" id="webmoneyWMY" checked="checked" />
					  <?php } else { ?>
					  <input type="radio" name="payment" value="webmoneyWMY" id="webmoneyWMY" />
					  <?php } ?>
					  <label for="webmoneyWMY"><?php echo $text_webmoneyWMY; ?></label><br><br>
                  <?php } ?>
                  <?php if ($webmoney_visibleWMB) { ?>
					  <?php if ($payment == 'webmoneyWMB') { ?>
					  <input type="radio" name="payment" value="webmoneyWMB" id="webmoneyWMB" checked="checked" />
					  <?php } else { ?>
					  <input type="radio" name="payment" value="webmoneyWMB" id="webmoneyWMB" />
					  <?php } ?>
					  <label for="webmoneyWMB"><?php echo $text_webmoneyWMB; ?></label><br><br>
                  <?php } ?>
                  <?php if ($webmoney_visibleWMG) { ?>
					  <?php if ($payment == 'webmoneyWMG') { ?>
					  <input type="radio" name="payment" value="webmoneyWMG" id="webmoneyWMG" checked="checked" />
					  <?php } else { ?>
					  <input type="radio" name="payment" value="webmoneyWMG" id="webmoneyWMG" />
					  <?php } ?>
					  <label for="webmoneyWMG"><?php echo $text_webmoneyWMG; ?></label>
                  <?php } ?>
               </td>

            


















          </tr>

        </tbody>

        
			
			  	<tbody id="payment-cheque" class="payment">
                    <tr>
                        <td><?php echo $entry_cheque; ?></td>
                        <td><input type="text" name="cheque" value="<?php echo $cheque; ?>" /></td>
                    </tr>
                </tbody>
                <tbody class="payment" id="payment-paypal">
                    <tr>
                        <td><?php echo $entry_paypal; ?></td>
                        <td><input type="text" name="paypal" value="<?php echo $paypal; ?>" /></td>
                    </tr>
                </tbody>
                <tbody id="payment-bank" class="payment">
                    <tr>
                        <td><?php echo $entry_bank_name; ?></td>
                        <td><input type="text" name="bank_name" value="<?php echo $bank_name; ?>" /></td>
                    </tr>
                    <tr>
                        <td><?php echo $entry_bank_branch_number; ?></td>
                        <td><input type="text" name="bank_branch_number" value="<?php echo $bank_branch_number; ?>" /></td>
                    </tr>
                    <tr>
                        <td><?php echo $entry_bank_swift_code; ?></td>
                        <td><input type="text" name="bank_swift_code" value="<?php echo $bank_swift_code; ?>" /></td>
                    </tr>
                    <tr>
                        <td><?php echo $entry_bank_account_name; ?></td>
                        <td><input type="text" name="bank_account_name" value="<?php echo $bank_account_name; ?>" /></td>
                    </tr>
                    <tr>
                        <td><?php echo $entry_bank_account_number; ?></td>
                        <td><input type="text" name="bank_account_number" value="<?php echo $bank_account_number; ?>" /></td>
                    </tr>
                </tbody>
                <tbody id="payment-qiwi" class="payment">
                    <tr>
                        <td><?php echo $entry_qiwi; ?></td>
                        <td><span class="required">*</span><input type="text" name="qiwi" value="<?php echo $qiwi; ?>" /></td>
                        <td><?php echo $title_qiwi; ?></td>
                    </tr>
                </tbody>
                <tbody class="payment" id="payment-card">
                    <tr>
                        <td><?php echo $entry_card; ?></td>
                        <td><span class="required">*</span><input type="text" name="card" value="<?php echo $card; ?>" /></td>
                        <td><?php echo $title_card; ?></td>
                    </tr>
                </tbody>
                <tbody class="payment" id="payment-yandex">
                    <tr>
                        <td><?php echo $entry_yandex; ?></td>
                        <td><span class="required">*</span><input type="text" name="yandex" value="<?php echo $yandex; ?>" /></td>
                        <td><?php echo $title_yandex; ?></td>
                    </tr>
                </tbody>
                <tbody class="payment" id="payment-webmoney">
                    <tr>
                        <td><?php echo $entry_webmoney; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoney" value="<?php 
                                                                  if($webmoney){ echo $webmoney;}
                                                                  else { echo 'R'; } ?>" /></td>
                        <td><?php echo $title_webmoney; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWMZ">
                    <tr>
                        <td><?php echo $entry_webmoneyWMZ; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWMZ" value="<?php 
                                                                  if($webmoneyWMZ){ echo $webmoneyWMZ;}
                                                                  else { echo 'Z'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWMZ; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWMU">
                    <tr>
                        <td><?php echo $entry_webmoneyWMU; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWMU" value="<?php 
                                                                  if($webmoneyWMU){ echo $webmoneyWMU;}
                                                                  else { echo 'U'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWMU; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWME">
                    <tr>
                        <td><?php echo $entry_webmoneyWME; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWME" value="<?php 
                                                                  if($webmoneyWME){ echo $webmoneyWME;}
                                                                  else { echo 'E'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWME; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWMY">
                    <tr>
                        <td><?php echo $entry_webmoneyWMY; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWMY" value="<?php 
                                                                  if($webmoneyWMY){ echo $webmoneyWMY;}
                                                                  else { echo 'Y'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWMY; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWMB">
                    <tr>
                        <td><?php echo $entry_webmoneyWMB; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWMB" value="<?php 
                                                                  if($webmoneyWMB){ echo $webmoneyWMB;}
                                                                  else { echo 'B'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWMB; ?></td>
                    </tr>
                </tbody>
				<tbody class="payment" id="payment-webmoneyWMG">
                    <tr>
                        <td><?php echo $entry_webmoneyWMG; ?></td>
                        <td><span class="required">*</span><input type="text" name="webmoneyWMG" value="<?php 
                                                                  if($webmoneyWMG){ echo $webmoneyWMG;}
                                                                  else { echo 'G'; } ?>" /></td>
                        <td><?php echo $title_webmoneyWMG; ?></td>
                    </tr>
                </tbody>
			
            


































      </table>



            <table>
                <tbody class="error" >
                    <tr> 
                        <td><?php echo $error_qiwi; ?></td>
                        <td><?php echo $error_card; ?></td>
                        <td><?php echo $error_yandex; ?></td>
                        <td><?php echo $error_webmoney; ?></td>
						<td><?php echo $error_webmoneyWMZ; ?></td>
						<td><?php echo $error_webmoneyWMU; ?></td>
						<td><?php echo $error_webmoneyWME; ?></td>
						<td><?php echo $error_webmoneyWMY; ?></td>
						<td><?php echo $error_webmoneyWMB; ?></td>
						<td><?php echo $error_webmoneyWMG; ?></td>
                    </tr>
                </tbody>
            </table>

            
    </div>

    <h2><?php echo $text_your_password; ?></h2>

    <div class="content">

      <table class="form">

        <tr>

          <td><span class="required">*</span> <?php echo $entry_password; ?></td>

          <td><input type="password" name="password" value="<?php echo $password; ?>" />

            <?php if ($error_password) { ?>

            <span class="error"><?php echo $error_password; ?></span>

            <?php } ?></td>

        </tr>

        <tr>

          <td><span class="required">*</span> <?php echo $entry_confirm; ?></td>

          <td><input type="password" name="confirm" value="<?php echo $confirm; ?>" />

            <?php if ($error_confirm) { ?>

            <span class="error"><?php echo $error_confirm; ?></span>

            <?php } ?></td>

        </tr>

      </table>

    </div>

    <h2> <!-- <?php echo $text_captcha; ?> --></h2>

    <div class="content">

      <table class="form">

        <tr>

<tr>

            <td><!--<?php  echo $entry_captcha; ?>--><br />
                  <!--     value="<?php echo $captcha; ?>" -->
              <input type="text" name="captcha"  />

              <!--<?php if ($error_captcha) { ?>

              <span class="error"><?php echo $error_captcha; ?></span>

              <?php } ?>-->

              <br />

              <img src="index.php?route=information/contact/captcha" /></td>

          </tr>



        </tr>

      </table>

    </div>

    <?php if ($text_agree) { ?>

    <div class="buttons">

      <div class="right"><?php echo $text_agree; ?>

        <?php if ($agree) { ?>

        <input type="checkbox" name="agree" value="1" checked="checked" />

        <?php } else { ?>

        <input type="checkbox" name="agree" value="1" />

        <?php } ?>

        <input type="submit" value="<?php echo $button_continue; ?>" class="button" />

      </div>

    </div>

    <?php } else { ?>

    <div class="buttons">

      <div class="right">

        <input type="submit" value="<?php echo $button_continue; ?>" class="button" />

      </div>

    </div>

    <?php } ?>

  </form>

  <?php echo $content_bottom; ?></div>

<script type="text/javascript"><!--

$('select[name=\'country_id\']').bind('change', function() {

	$.ajax({

		url: 'index.php?route=affiliate/register/country&country_id=' + this.value,

		dataType: 'json',

		beforeSend: function() {

			$('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="catalog/view/theme/palioxis/image/loading.gif" alt="" /></span>');

		},

		complete: function() {

			$('.wait').remove();

		},			

		success: function(json) {

			if (json['postcode_required'] == '1') {

				$('#postcode-required').show();

			} else {

				$('#postcode-required').hide();

			}

			

			html = '<option value=""><?php echo $text_select; ?></option>';

			

			if (json['zone'] != '') {

				for (i = 0; i < json['zone'].length; i++) {

        			html += '<option value="' + json['zone'][i]['zone_id'] + '"';

	    			

					if (json['zone'][i]['zone_id'] == '<?php echo $zone_id; ?>') {

	      				html += ' selected="selected"';

	    			}

	

	    			html += '>' + json['zone'][i]['name'] + '</option>';

				}

			} else {

				html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';

			}

			

			$('select[name=\'zone_id\']').html(html);

		},

		error: function(xhr, ajaxOptions, thrownError) {

			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);

		}

	});

});



$('select[name=\'country_id\']').trigger('change');

//--></script>

<script type="text/javascript"><!--

$('input[name=\'payment\']').bind('change', function() {

	$('.payment').hide();

	

	$('#payment-' + this.value).show();

});



$('input[name=\'payment\']:checked').trigger('change');

//--></script> 

<script type="text/javascript"><!--

$('.colorbox').colorbox({

	width: 640,

	height: 480

});

//--></script> 

<?php echo $footer; ?>

